<?php
require_once '../util/timer.php';
$stimer = mtimer();

require_once '../config.php';
require_once '../db/get/user.php';

require_once '../util/consts.php';
require_once '../util/Bitter.php';

$_TPL = array();

showFora();
echo '<center>',mtimer( $stimer ),'</center>';

function showFora() {
  global $_TPL;
  $uid = (string)$_REQUEST['uid'];

  if( $uid > 0 )
    $user = getUserById($uid);
  else {
    if( !$_SESSION['uid'] ) {
      require_once('../util/user.php');
      loginDrone('guest');
    }
    $user = getUserById($_SESSION['uid']);
  }

  if( !isset($user['id']) ) 
    return showTpl('Error');

  $_TPL['uid'] = $user['id'];
  $_TPL['uname'] = $user['name'];
  $_TPL['joindate'] = $user['joindate'];

  showTpl('UserProfile');
}

?>
